package serverx

import (
	"gitee.com/workits/pkgs/contextx"
	"github.com/gin-gonic/gin"
)

func WithTraceid() gin.HandlerFunc {
	return func(ctx *gin.Context) {
		ctx.Request = ctx.Request.WithContext(contextx.WithTraceId(ctx.Request.Context()))
		ctx.Next()
	}
}
